package com.dong.bean;

import org.springframework.beans.factory.InitializingBean;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

/**
 * description
 *
 * @author Administrator 2021/08/30 10:43
 */
public class MyInitializingBean implements InitializingBean {

    static{
        System.out.println("静态代码块");
    }

    @PostConstruct
    public void postConstruct(){
        System.out.println("postConstruct");
    }

    public MyInitializingBean(){
        System.out.println("构造方法");
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("afterPropertiesSet");
    }

    public void method(){
        System.out.println("init方法");
    }

    @PreDestroy
    public void preDestroy(){
        System.out.println("preDestroy");
    }

    public void print(){
        System.out.println("hello world");
    }
}
